Micron Document
🎖️GitЯра🎖️

Node / meshtastic / Meshtastic-Android / files / core / ui / src / commonMain / kotlin / org / meshtastic / core / ui / util / ActiveWhileStarted.kt

Displaying Raw • Download

core/ui/src/commonMain/kotlin/org/meshtastic/core/ui/util/ActiveWhileStarted.kt 9613ba91a7e169afe8ce2e98c6d384ef37f03421 (9613ba91) Text, 1.66 KB

T8b949e/*
* Copyright (c) 2026 Meshtastic LLC
*
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation, either version 3 of the License, or
* (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program. If not, see <https://www.gnu.org/licenses/>.
*/
Tff7b72package T7ee787org.meshtastic.core.ui.util

Tff7b72import T7ee787androidx.compose.runtime.Composable
Tff7b72import T7ee787androidx.compose.runtime.getValue
Tff7b72import T7ee787androidx.compose.runtime.rememberUpdatedState
Tff7b72import T7ee787androidx.lifecycle.compose.LifecycleStartEffect

T8b949e/**
* Runs [effect] while the current lifecycle is at least STARTED and [enabled] is true.
*
* Changing a [restartKeys] value restarts an active effect. The returned cleanup callback is invoked synchronously on
* ON_STOP, disable, or composition disposal. If that callback cancels coroutine work, downstream cleanup such as a
* `callbackFlow` provider's `awaitClose` runs as cancellation resumes.
*/
Tf0883e@Composable
Tff7b72fun Td2a8ffActiveWhileStartedTb4b4b4(Tff7b72vararg Te6edf3restartKeysTb4b4b4: Tffa657Any?Tb4b4b4, Te6edf3enabledTb4b4b4: Tffa657Boolean Tff7b72= Tff7b72trueTb4b4b4, Te6edf3effectTb4b4b4: Tb4b4b4(Tb4b4b4) Tff7b72-Tff7b72> Tb4b4b4(Tb4b4b4) Tff7b72-Tff7b72> Tffa657UnitTb4b4b4) Tb4b4b4{
Tff7b72val Te6edf3currentEffect Tff7b72by Te6edf3rememberUpdatedStateTb4b4b4(Te6edf3effectTb4b4b4)

Te6edf3LifecycleStartEffectTb4b4b4(Te6edf3enabledTb4b4b4, Tff7b72*Te6edf3restartKeysTb4b4b4) Tb4b4b4{
Tff7b72val Te6edf3cleanup Tff7b72= Tff7b72if Tb4b4b4(Te6edf3enabledTb4b4b4) Te6edf3currentEffectTb4b4b4(Tb4b4b4) Tff7b72else Tb4b4b4(Tb4b4b4{Tb4b4b4}Tb4b4b4)
Te6edf3onStopOrDispose Tb4b4b4{ Te6edf3cleanupTb4b4b4(Tb4b4b4) Tb4b4b4}
Tb4b4b4}
Tb4b4b4}

Served by rngit 1.5.0 - Generated in 0.04s